package cn.com.pc.content.converter;

import cn.com.pc.content.domain.Site;
import cn.com.pc.content.util.JsonUtils;
import com.fasterxml.jackson.core.type.TypeReference;
import org.springframework.core.convert.converter.Converter;

import java.util.Map;

/**
 * Spring MVC Map 转换
 */
public class MapConverter implements Converter<String, Map<String, Object>> {
    @Override
    public Map<String, Object> convert(String s) {
        return JsonUtils.jsonToObj(s, new TypeReference<Map<String, Object>>(){});
    }
}